package odgs.message;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Message implements Serializable
{
	public static final String CONTENTS_ADD_TRANSACTION_REQEUST	= "ContentsAddTransactionRequest";
	public static final String CONTENTS_ADD_TRANSACTION_RESPONSE = "ContentsAddTransactionResponse";
	public static final String CONTENTS_GET_TRANSACTION_REQUEST = "ContentsGetTransactionRequest";
	public static final String CONTENTS_REMOVE_TRANSACTION_REQUEST	= "ContentsRemoveTransactionRequest";
	public static final String CONTENTS_REMOVE_TRANSACTION_RESPONSE = "ContentsRemoveTransactionResponse";
	public static final String DIRCTORY_REMOVE_TRANSACTION_REQUEST	= "DirectoryRemoveTransactionRequest";
	public static final String DIRCTORY_REMOVE_TRANSACTION_RESPONSE	= "DirectoryRemoveTransactionResponse";
	public static final String DIRECTORY_ADD_TRANSACTION_REQUEST = "DirectoryAddTransactionRequest";
	public static final String DIRECTORY_ADD_TRANSACTION_RESPONSE = "DirectoryAddTransactionResponse";
	public static final String FILE_DELETE_COMPLETE = "FileDeleteComplete";
	public static final String FILE_DELETE_ORDER = "FileDeleteOrderResponse";
	public static final String FILE_RECEIVE_REQUEST	= "FileReceiveRequest";
	public static final String FILE_SEND_COMPLETE = "FileSendComplete";
	public static final String JOIN_REQEST = "JoinRequest";
	public static final String JOIN_RESPONSE = "JoinResponse";
	public static final String LOGIN_REQUEST = "LoginRequest";
	public static final String LOGIN_RESPONSE = "LoginResponse";
	public static final String SELECT_NODE_RESPONSE	= "SelectNodeResponse";
	public static final String TRANSACTION = "Transaction";
	public static final String TRANSACTION_BROADCAST = "TransactionBroadcast";
	public static final String CONTENTS_GET_TRANSACTION_RESPONSE = "ContentsGetTransactionResponse";
	public static final String FILE_SEND_REQEUST = "FileSendRequst";
	public static final String RENAME_TRANSACTION_REQUEST = "RenameTransactionRequest";
	public static final String RENAME_TRANSACTION_RESPONSE = "RenameTransactionResponse";
	public static final String COPY_REQUEST_TRANSACTION = "CopyRequestTransaction";
	public static final String COPY_RESPONSE_TRANSACTION = "CopyResponseTransaction";
	public static final String MOVE_REQUEST_TRANSACTION = "MoveRequestTransaction";
	public static final String MOVE_RESPONSE_TRANSACTION = "MoveResponseTransaction";
	public static final String CONTENTS_EXECUTE_TRANSACTION_REQUEST = "ExecuteTransactionRequest";
	public static final String CONTENTS_EXECUTE_TRANSACTION_RESPONSE = "ExecuteTransactionResponse";
	public static final String CONTENTS_ADDED_COMPLETE = "ContentsAddedComplete";
	public static final String UPDATE_GRID_STATE = "UpdateGridState";
	public static final String UN_LOCK_CONTENTS = "UnLockContentsRequest";
	public static final String TRANSACTION_CANCEL = "TransactionCancelRequest";

	private Map<String, Object> data;
	private String name;
	private int result;

	public Message()
	{
		data = new HashMap<String, Object>();
	}
	
	public Message(String name)
	{
		this();
		this.name = name;
	}
	
	public String getName()
	{
		return name;
	}

	public int getResult()
	{
		return result;
	}

	public void setName(String name)
	{
		this.name = name;
	}
	
	public void setResult(int result)
	{
		this.result = result;
	}
	
	public void put(String key, Object value)
	{
		data.put(key, value);
	}
	
	public Object get(String key)
	{
		return data.get(key);
	}                                                                                                                   
	
	public Set<String> getKeys()
	{
		return data.keySet();
	}
}